#ifndef QERRORMANAGER_H
#define QERRORMANAGER_H

#include <QObject>
#include <QHash>
#include "qerrorinifile.h"
#include "qerreur.h"
#include "error_define.h"
class QEXPPart;

class QErrorManager
{
public:
  ~QErrorManager();
  void analyze(const QStringList& noPart,const QStringList& commonPart,const QStringList& pages,QEXPPart* part);
  void reset(QStringList plp,QStringList exportPlp);
  static QErrorManager* instance();
  static void destroy();

private:
  static QErrorManager* m_instance;
  QErrorManager();
  QList<QEXPPart*> search(QString field,QString value);
  QErreur* getError(QString id);
  QHash<QString,QErreur*>  m_errors;
  QList<QEXPPart*> m_parts;
  QStringList m_plp;
  QStringList m_export;

};

#define __analyzePart(__LIST_NO_PART__,__LIST_COMMON_PART__,__LIST_PAGES__,__PART__) QErrorManager::instance()->analyze(__LIST_NO_PART__,__LIST_COMMON_PART__,__LIST_PAGES__,__PART__)
#define __resetManager(__PLP__,__EXPORTPLP__)    QErrorManager::instance()->reset(__PLP__,__EXPORTPLP__)
#endif // QERRORMANAGER_H
